﻿using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Linq;
using System.Printing;
using System.Text;
using System.Threading.Tasks;

namespace PPP.Utils.Services {
    /// <summary>
    /// Helper Class to process printer stuff.
    /// 
    /// <list type="bullet">
    /// <item>
    /// <term>Author</term>
    /// <description>Sebastian Will</description>
    /// </item>
    /// </list>
    /// 
    /// </summary> 
    public class PrinterHandler {

        /// <summary>
        /// Get the default printer settings.
        /// </summary>
        /// <returns></returns>
        public static PrinterSettings GetDefaultPrinterSettings() {
            PrinterSettings settings = new PrinterSettings();
            return settings;        
        }

        /// <summary>
        /// Get the printer settings of a printer.
        /// </summary>
        /// <param name="printerName"></param>
        /// <returns></returns>
        public static PrinterSettings GetPrinterSettings(string printerName) {
            PrinterSettings settings = new PrinterSettings();
            settings.PrinterName = printerName;
            return settings;
        }

        /// <summary>
        /// Convert a string to the PageOrientation.
        /// </summary>
        /// <param name="pageOrientation"></param>
        /// <returns></returns>
        public static PageOrientation StringToPageOrientation(string pageOrientation) {
            switch (pageOrientation) {
                case "Landscape":
                    return PageOrientation.Landscape;
                    break;
                case "Portrait":
                    return PageOrientation.Portrait;
                    break;
                case "Unknown":
                    return PageOrientation.Unknown;
                    break;
                default:
                    return PageOrientation.Unknown;
                    break;
            }
        }

        /// <summary>
        /// Convert a PageOrientation to a string.
        /// </summary>
        /// <param name="pageOrientation"></param>
        /// <returns></returns>
        public static string PageOrientationToString(PageOrientation pageOrientation) {
            switch (pageOrientation) {
                case PageOrientation.Landscape:
                    return "Landscape";
                    break;
                case PageOrientation.Portrait:
                    return "Portrait";
                    break;
                case PageOrientation.ReverseLandscape:
                    return "Landscape";
                    break;
                case PageOrientation.ReversePortrait:
                    return "Portrait";
                    break;
                case PageOrientation.Unknown:
                    return "Unknown";
                    break;
                default:
                    return "Unknown";
                    break;
            }
        }
    }
}
